﻿@{
    ViewBag.Title = "物资检斤信息";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section scripts{
    <script src="~/Areas/Weight/ViewModels/Weight.viewModel.search.js"></script>
    <script type="text/javascript">
        var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
        var viewModel = function(){
            var self = this;
            Weight.viewModel.search.apply(this,arguments);
        }
        ko.bindingViewModel(new viewModel(data));

        com.formatJCFS = function(value,row){
            if(value=="0")
                return "物资检斤";
            else if(value=="1")
                return "销售检斤";
            else
                return "内转检斤";
        };

        com.formatBS = function(value,row){
            if(value=="0")
                return "已进厂";
            else if(value=="1")
                return "已出厂";
            else
                return "异常";
        };
    </script>
}
<div class="z-toolbar">
    <a id="a_refresh" href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh" title="刷新" data-bind="click:refreshClick">刷新</a>
    @*<a id="a_add" href="#" plain="true" class="easyui-linkbutton" icon="icon-add" title="新增" data-bind="click:deleteClick" >新增</a>
        <a id="a_edit" href="#" plain="true" class="easyui-linkbutton" icon="icon-edit" data-bind="click:deleteClick" title="编辑" >编辑</a>
        <a id="a_del" href="#" plain="true" class="easyui-linkbutton" icon="icon-cross" title="删除" data-bind="click:deleteClick"  >删除</a>
        <a id="a_audit" href="#" plain="true" class="easyui-linkbutton" icon="icon-user-accept" data-bind="click:auditClick" title="审核">审核</a>*@
    <a id="a_export" href="#" class="easyui-splitbutton" data-options="menu:'#dropdown',iconCls:'icon-download'">导出</a>
</div>

<div id="dropdown" style="width:100px; display:none;">
    <div data-options="iconCls:'icon-ext-xls'" suffix="xls" data-bind="click:downloadClick">Excel2003   </div>
    <div data-options="iconCls:'icon-page_excel'" suffix="xlsx" data-bind="click:downloadClick">Excel2007   </div>
    <div data-options="iconCls:'icon-ext-doc'" suffix="doc" data-bind="click:downloadClick">Word2003    </div>
</div>

<div id="condition" class="container_12" style="position:relative;">
    <div class="grid_1 lbl">检斤编号</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.S_CRCJJBH" class="z-txt" /></div>
    <div class="grid_1 lbl">车牌号</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.S_CPH" class="z-txt" /></div>
    <div class="grid_1 lbl">供应商</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.S_FHDWMC" class="z-txt" /></div>
    <div class="clear"></div>

    <div class="grid_1 lbl">进厂日期</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.D_RCSJ" formatter="com.formatDate" class="z-txt easyui-daterange" /></div>
    <div class="grid_1 lbl">进厂方式</div>
    <div class="grid_2 val"><input type="text" data-bind="datasource:dataSource.jinchangFSItems ,comboboxValue:form.I_JCFS" class="z-txt easyui-combobox" data-options="showblank:true" /></div>
    <div class="grid_1 lbl">进厂状态</div>
    <div class="grid_2 val"><input type="text" data-bind="datasource:dataSource.jinchangItems ,comboboxValue:form.B_BS" class="z-txt easyui-combobox" data-options="showblank:true" /></div>
    <div class="clear"></div>

    <div class="prefix_9" style="position:absolute;top:5px;height:0;">
        <a id="a_search" href="#" class="button button-blue" style="margin:0 15px;" data-bind="click:searchClick">查询</a>
        <a id="a_reset" href="#" class="button button-blue" data-bind="click:clearClick">清空</a>
    </div>
</div>


<table id="gridlist" data-bind="datagrid:grid">
    <thead>
        <tr>
            <th field="S_CRCJJBH" sortable="true" align="left" width="100">编号</th>
            <th field="I_JCFS" sortable="true" align="left" width="60" formatter="com.formatJCFS">进厂方式</th>
            <th field="B_BS" sortable="true" align="left" width="56" formatter="com.formatBS">状态</th>
            <th field="S_FHDWMC" sortable="true" align="left" width="150">供应商</th>
            <th field="S_CPH" sortable="true" align="left" width="80">车牌号</th>
            <th field="S_WZMC" sortable="true" align="left" width="90">物资名称</th>
            <th field="S_WZSL" sortable="true" align="right" width="30">数量</th>
            <th field="S_WZDW" sortable="true" align="left" width="30">单位</th>
            <th field="N_SHMZ" sortable="true" align="right" formatter="com.formatMoney" width="80">总毛重(kg)</th>
            <th field="N_SHPZ" sortable="true" align="right" formatter="com.formatMoney" width="80">总皮重(kg)</th>
            <th field="N_SHJZ" sortable="true" align="right" formatter="com.formatMoney" width="80">总净重(kg)</th>
            <th field="D_RCSJ" sortable="true" align="center" width="130" formatter="com.formatTime">进厂时间</th>
            <th field="D_CCSJ" sortable="true" align="center" width="130" formatter="com.formatTime">出厂时间</th>
            <th field="N_GHMZ" sortable="true" align="right" formatter="com.formatMoney" width="80">供货毛重(kg)</th>
            <th field="N_GHPZ" sortable="true" align="right" formatter="com.formatMoney" width="80">供货皮重(kg)</th>
            <th field="N_GHJZ" sortable="true" align="right" formatter="com.formatMoney" width="80">供货净重(kg)</th>
            <th field="S_FHDD" sortable="true" align="left" width="150">发货地点</th>
            <th field="S_SHDD" sortable="true" align="left" width="150">收货地点</th>
            <th field="S_CYDW" sortable="true" align="left" width="150">承运单位</th>
            <th field="S_BZ" sortable="true" align="left" width="200">备注</th>
        </tr>
    </thead>
</table>